package com.diligreat.action;

import java.util.List;

import com.diligreat.action.base.BaseAction;
import com.diligreat.domain.Content;
import com.diligreat.service.IndexService;

public class ConsultingAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	private long page=1;
	private long pages=0;
	private long articles=0;
	
	private List<Content> articleslist;
	
	private IndexService indexService;
	
	private String[] vpro;
	private long[] vt;
	
	public String consultingoverview()
	{
		Long l=Long.parseLong((String) this.getHttpSession().getAttribute("lang"));
		
		this.articleslist=this.indexService.getOverviewArticles(l, 1);
		return SUCCESS;
	}
	
	public String consultingservices()
	{
		Long l=Long.parseLong((String) this.getHttpSession().getAttribute("lang"));
		this.pages=this.indexService.getTotalPages(l, 1,1);
		this.articles=this.indexService.getTotalArtcles(l, 1,1);
		this.articleslist=this.indexService.getArticles(l, 1, 1, this.page,this.vpro,this.vt);
		
		return SUCCESS;
	}
	
	
	public String consultingrai()
	{
		Long l=Long.parseLong((String) this.getHttpSession().getAttribute("lang"));
		this.pages=this.indexService.getTotalPages(l, 1,2);
		this.articles=this.indexService.getTotalArtcles(l, 1,2);
		this.articleslist=this.indexService.getArticles(l, 1, 2, this.page,this.vpro,this.vt);
		
		return SUCCESS;
	}
	
	public String consultingcs()
	{
		Long l=Long.parseLong((String) this.getHttpSession().getAttribute("lang"));
		this.pages=this.indexService.getTotalPages(l, 1,3);
		this.articles=this.indexService.getTotalArtcles(l, 1,3);
		this.articleslist=this.indexService.getArticles(l, 1, 3, this.page,this.vpro,this.vt);
		
		return SUCCESS;
	}


	public IndexService getIndexService() {
		return indexService;
	}

	public void setIndexService(IndexService indexService) {
		this.indexService = indexService;
	}

	public long getPages() {
		return pages;
	}

	public void setPages(long pages) {
		this.pages = pages;
	}

	public long getArticles() {
		return articles;
	}

	public void setArticles(long articles) {
		this.articles = articles;
	}

	public long getPage() {
		return page;
	}

	public void setPage(long page) {
		this.page = page;
	}

	public List<Content> getArticleslist() {
		return articleslist;
	}

	public void setArticleslist(List<Content> articleslist) {
		this.articleslist = articleslist;
	}

	public String[] getVpro() {
		return vpro;
	}

	public void setVpro(String[] vpro) {
		this.vpro = vpro;
	}

	public long[] getVt() {
		return vt;
	}

	public void setVt(long[] vt) {
		this.vt = vt;
	}

}
